package Chapter22;

public class StringDemo {
    public static void main(String[] args) {
        /* String aaa = new String("Hello");
        String bbb = new String("Hello");
        String ccc = "Hello";
        String ddd = "Hello";

        System.out.println("aaa和bbb是否相等: " + aaa == bbb);
        System.out.println("aaa和bbb是否相同" + aaa.equals(bbb));
        System.out.println("ccc和ddd是否相同" + ccc == ddd);
        System.out.println("ccc和ddd是否相同" + ccc.equals(ddd));
        System.out.println();

        System.out.println(aaa.hashCode());
        System.out.println(bbb.hashCode());
        System.out.println(ccc.hashCode());
        System.out.println(ddd.hashCode());*/

        String str1 = "ab";
        String str2 = "ab";
        String str3 = "你好";
        char char1 = '你';
        char char2 = '好';
        Integer int1 = 10;
        Object obj = new Object();
        System.out.println(obj);
        System.out.println(obj.hashCode());

        System.out.println(char1 + 0);
        System.out.println(char2 + 0);

        System.out.println(str3.hashCode());
        System.out.println(str2.hashCode());
        System.out.println(str1 == str2);
    }
}
